package cn.yto.print.enums;

import lombok.Getter;

@Getter
public enum PrintStatusEnum {

    /* 控制台消息类型 */
    PRINTING_STATUS(0, "正在打印", "print.history.startPrint"),
    PRINT_SUCCESS_STATUS(1, "打印成功", "print.history.success"),
    PRINT_FAILURE_STATUS(2, "打印失败", "print.history.failure");

    private final Integer status;
    private final String desc;
    private final String locale;

    PrintStatusEnum(Integer status, String desc, String locale) {
        this.status = status;
        this.desc = desc;
        this.locale = locale;
    }

    public static PrintStatusEnum getStatusByStatus(Integer status) {
        for (PrintStatusEnum value : PrintStatusEnum.values()) {
            if (value.getStatus().equals(status)) {
                return value;
            }
        }
        return null;
    }

    public static PrintStatusEnum getStatusByDesc(String desc) {
        for (PrintStatusEnum value : PrintStatusEnum.values()) {
            if (value.getDesc().equals(desc)) {
                return value;
            }
        }
        return null;
    }

}
